package org.xiaojinlong.exam;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String str = scanner.nextLine();
            char[] chars = str.toCharArray();
            int i = 0;
            int j = chars.length - 1;
            int flag = 0;
            while (flag < 2 && ((i + 1) <= (j - 1))) {
                if (chars[i] == chars[j]) {
                    i++;
                    j--;
                } else if (chars[i] == chars[j-1]) {
                    flag++;
                    i++;
                    j -= 2;
                } else if (chars[i+1] == chars[j]) {
                    flag++;
                    i += 2;
                    j--;
                } else
                    flag = 2;
            }
            if (flag < 2)
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }
}
